home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / Review.dxr / 00034_set Many of a Group.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  1.5 KB  |  34 lines

  1. property firstSprite, buttonNum, questionNum
  2. global gReviewData
  3.  
  4. on beginSprite me
  5.   set the buttonNum of me to the spriteNum of me - (the firstSprite of me - 1)
  6.   setPrevChoice(me)
  7. end
  8.  
  9. on setPrevChoice me
  10.   set myValue to getAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me)
  11.   if myValue = 1 then
  12.     sendSprite(the spriteNum of me, #Toggle)
  13.   end if
  14. end
  15.  
  16. on mouseDown me
  17.   set myValue to getAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me)
  18.   case myValue of
  19.     0:
  20.       setAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me, 1)
  21.     1:
  22.       setAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me, 0)
  23.   end case
  24. end
  25.  
  26. on getPropertyDescriptionList
  27.   set p_list to [#questionNum: [#comment: "Question number for this button:", #format: #integer, #range: [#min: 1, #max: 25], #default: 1], #firstSprite: [#comment: "First sprite of series:", #format: #integer, #range: [#min: 10, #max: 20], #default: 10]]
  28.   return p_list
  29. end
  30.  
  31. on getBehaviorDescription
  32.   return "Each sprite will know its position in a group based on its sprite number." & RETURN & "It will also know what question it is applied to." & RETURN & "From these properties we can keep score in a global." & RETURN & "‚Ä¢ Question number - choose from the range." & RETURN & "‚Ä¢ First sprite - so the first sprite in the series gets a 1, etc." & RETURN & "NOTES:" & RETURN & "Uses global variable to keep track of button position, ON or OFF."
  33. end
  34.